<?php
global $Config;
require_once($Config->WebCMSRoot.'Base/View.php');

Class ImageGalleryView extends BaseView
{
	function ImageGalleryView()
	{
		parent::BaseView();
	}
	
	function ShowGallery(&$fotos, $page, $pageSize, $fotosPerRow=-1)
	{
		if (count($fotos->Collection) > 0)
		{
		    $this->output  = '<div id="gallery">';
		    $this->output .= '<div id="controls" class="controls"></div>';
		    $this->output .= '<div id="slideshow" class="slideshow"></div>';
		    $this->output .= '</div>';

		    $this->output .= '<div id="navigation" class="navigation">';
		    $this->output .= '<ul class="thumbs noscript">';
		    
		    foreach ($fotos->Collection as $key=>$foto)
		    {
				$this->output .= '<li><a href="' . $foto->File . '">';
				$this->output .= '<img src="' . $foto->Thumbnail . '" border="0" alt="" />';
				$this->output .= '</a></li>';
			}

			$this->output .= '</ul>';
			$this->output .= '</div>';
		}
	}

	/*function ShowPager(&$fotos, $current, $pageSize, $flag)
	{
		if (count($fotos->Collection) > 0)
		{
			switch ($flag)
			{
				case 'r':
					$page = 'repetities';
					break;
				case 'f':
				default:
					$page = 'fotos';
					break;
			}
		    $this->output = '<div class="fotoRow pager">';
		    
			for ($i=1; $i <= ceil(count($fotos->Collection)/$pageSize); $i++)
			{
				if ($i == $current)
				{
					$this->output .= ' [' . $i . '] ';
				} else {
					$this->output .= ' <a href="/'.$page.'/' . $fotos->Voorstelling->Collection[0]->Jaar . '/' . $i . '">' . $i . '</a> ';
				}
			}
		    
		    $this->output .= '</div>';
		}
	}*/
}
?>